package com.yl.common.core.domain.message;

import lombok.Data;
import lombok.Getter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @author yuyu
 */
@Data
@Accessors(chain = true)
public class MessageInfo<T> implements Serializable {
    public MessageInfo(){

    }

    public MessageInfo(String event,T content){
        this.event = event;
        this.content = content;
    }

    /**
     * 事件类型
     */
    private String event;

    /**
     * 内容json
     */
    private T content;

    @Getter
    public enum EventEnum{

        // 事件类型  content
        device_state("device_state", "设备状态"),
        lamp_switch("lamp_switch", "灯开关"),
        curtain_switch("curtain_switch", "窗帘开合"),
        maintain_change_state_refresh("maintain_change_state_refresh", "保养更换状态刷新");

        private String code;
        private String name;

        EventEnum(String code, String name) {
            this.code = code;
            this.name = name;
        }


    }
}
